<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>服装款式</title>
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
    <script src="${ctxStatic}/js/jquery-1.9.1.min.js"></script>
    <script src="${ctxStatic}/js/DateTimePicker.js"></script>
    <script src="${ctxStatic}/js/layer.js"></script>
    <script src="${ctxStatic}/js/style.js"></script>
   	<script src="${ctxStatic}/dateCalendar/WdatePicker.js"></script>
    <link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
    <link rel="stylesheet" href="${ctxStatic}/css/list.css">
    <script>
    $(document).ready(function() {
    	$("#orderTypeCD").select2();
    	$("#indentStatusCD").select2();
        $(window.parent.$('#dtBox1')).DateTimePicker(
                {
                    dateFormat: "yyyy-MM-dd HH:mm",
                    parentElement: ".timeBox",
                }
        );

    });
	
	$(function(){
            $(".tabBox ul li").each(function(){
                var index=$(this).index();

                $(".tabBox ul li").eq(0).addClass("active");

                $(this).click(function(){

                    //alert(index);

                    $(this).addClass("active").siblings().removeClass("active");

                    //$(".tabBoxSm > .tabSm").eq(index).stop(true).show().siblings().stop(true).hide();
					$("#ulSelected").val($(this).val());
					searchListForm();
					var tableW = $(".tabBoxSm > .tabSm").eq(index).find('.tableHead').width();
					var tabodyH = $(".tabBoxSm > .tabSm").eq(index).find('.tableBody').height();
					var tableScrollH = $(".tabBoxSm > .tabSm").eq(index).find('.tableScroll').height();
					if(tabodyH>tableScrollH){
						$(".tabBoxSm > .tabSm").eq(index).find('.tableScroll').css('width',tableW + 18 + 'px')
					}else{
						$(".tabBoxSm > .tabSm").eq(index).find('.tableScroll').css('width','inherit')
					}

                })

            })

        })
        
        //检索 
    function searchListForm() {
    	var params = $("#searchForm").serialize();
    	$("#activity_pane").showLoading();
		$.post("${ctx}/putting/contract/searchList",params, function(result) {
			var listHtml = result["puttingContract"];
			var pageHtml = result["page"];
			$("#listHtml").html(listHtml);
			$("#paging").html(pageHtml);
			$("#activity_pane").hideLoading();
		}, 'json');
	}
        
	//重置
	function clean() {
		$("input").val("");
		$("select").val("");
		searchListForm();
	}   
    </script>
    
    <style type="text/css">
    
    /* 加工合同号  */
    .table-jghth{width: 150px}
    /* 加工厂(乙方) */
    .table-jgc{width: 150px}
    /* 款式数量  */
    .table-jgkssl{width: 80px}
    /* 外发数量   */
    .table-jgwfsl{width: 100px}
    /* 外发金额  */
    .table-jgwfje{width: 100px}
    /* 签订日期  */
    .table-jgqdrq{width: 100px}
    /* 预订到料日期  */
    .table-jgydjh{width: 100px}
    /* 实际到料日期  */
    .table-jgsjjh{width: 100px}
    /* 创建人员  */
    .table-jgcjr{width: 80px}
    /* 创建时间  */
    .table-jgcjrq{width: 100px}
    
    </style>
</head>
<body>
<form id="searchForm">
<div class="listArea" id="activity_pane">
	<div class="listBg">
        <div class="searchArea clearfix">
            <div class="searchLeft clearfix">
                <div class="searchInp clearfix">
                    <p><spring:message code="putting_contract_number" /></p>
                    <input class="w-styleNub" id="contractProcessNO" name="contractProcessNO" value="">
                </div>
                <div class="searchInp clearfix">
                    <p><spring:message code="putting_contract_factory" /></p>
                    <input class="w-customer" id="ognizationNameB" name="ognizationNameB" value="">
                </div>
                <div class="searchInp clearfix">
                    <p><spring:message code="putting_contract_date" /></p>
                    <div class="timeBox">
							<input type="text" class="laydate-icon" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',onpicked:null})"
								id="dateStart" name="dateStart" style="width: 110px">
							<p class="list">~</p>
							<input type="text" class="laydate-icon" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',onpicked:null})" id="dateEnd" name="dateEnd"
								style="width: 110px" >
                    </div>        
                </div>               
            </div>
            <div class="searchRight clearfix">
                <button type="button" onclick="searchListForm();"><spring:message code="commom_check" /></button>
                <button type="button" onclick="clean();"><spring:message code="common_reset" /></button>
                <button type="button" onclick="popup('1000px','650px','${ctx}/putting/contract/createContract')"><spring:message code="putting_contract_create" /></button>
            </div>
        </div>
        </div>
        <input type="hidden" id="ulSelected" name="ulSelected" value="">
    <div class="tabBox">
        <ul class="clearfix">
            <li class="active" value="-1"><spring:message code="putting_contract_all" /></li>
            <li value="5"><spring:message code="putting_contract_new" /></li>
            <li value="2"><spring:message code="putting_contract_audit_wait" /></li>
            <li value="1"><spring:message code="putting_contract_audit_ok" /></li>
            <li value="0"><spring:message code="putting_contract_audit_no" /></li>
            <li value="3"><spring:message code="putting_contract_complete" /></li>
            <li value="4"><spring:message code="putting_contract_delete" /></li>
        </ul>
	</div>
     <div class="listBg tabPadding overflowX">
        <div class="tableArea tabBoxSm">
            <div class="tableScrollSm" style = "height:650px;width: 1139px;overflow: auto;">
                <table cellpadding="0" class="tableHead">
                    <thead>
                    <tr>
                        <th><p class="table-No"><spring:message code="common_no" /></p></th>
                        <th><p class="table-jghth"><spring:message code="putting_contract_No" /></p></th>
                        <th><p class="table-jgc"><spring:message code="putting_contract_supplierB" /></p></th>
                        <th><p class="table-jgkssl"><spring:message code="putting_contract_kinds" /></p></th>
                        <th><p class="table-jgwfsl"><spring:message code="putting_contract_quantity" /></p></th>
                        <th><p class="table-jgwfje"><spring:message code="putting_contract_amount" /></p></th>
                        <th><p class="table-jgqdrq"><spring:message code="putting_contract_startDate" /></p></th>
                        <th><p class="table-jgydjh"><spring:message code="putting_contract_reserveDate" /></p></th>
                        <th><p class="table-jgsjjh"><spring:message code="putting_contract_realityDate" /></p></th>
                        <th><p class="table-jgcjr"><spring:message code="putting_contract_creator" /></p></th>
                        <th><p class="table-jgcjrq"><spring:message code="putting_contract_createDate" /></p></th>
                    </tr>
                    </thead>
                </table>
                <table cellpadding="0" class="tableBody">
                    <tbody id="listHtml">
                    
                    </tbody>
                </table>
            </div>           
        </div>
    </div>
    <div id = "paging" ></div>
   
<script type="text/javascript">
$(document).ready(function(){
	searchListForm();
	
	});

</script> 
</div>
</form>
</body>
</html>
